importClass(Packages.org.framework2.utils.XMLReader);
importClass(Packages.org.framework2.utils.HttpClientUtil);
importClass(Packages.org.framework2.utils.DBTools);

var xmlData = request.getParameter('xmldata');
print('请求的参数:' + xmlData);
var xmlReader = new XMLReader(xmlData);

var ret = '<?xml version="1.0" encoding="UTF-8"?>';
ret += '<InnerBus>';
ret += '<Response>';
ret += '<RspCode>000000</RspCode>';
ret += '<RspDesc>[TMPT]内容分发通知成功</RspDesc>';
ret += '</Response>';
ret += '</InnerBus>';
response.write(ret);
/*
彩铃平台回执
/CMS4-DIST/ibus/confirmDeployForColorringController.do
var logs = dbTools.select('select \'中文\' from dual');
println(logs);
var map = new java.util.HashMap();
map.put('xmlData',ret);
HttpClientUtil.post('http://localhost:8888/testCase/testcase2.do', 5000, map);
*/
var resourceIDs = new Array('000002','000008');
var transID = xmlReader.getNodeText('InnerBus.SvcCont.RbtDeployNotifyReq.TransactionID');
var procID = xmlReader.getNodeText('InnerBus.ProcID');
//
var retStr = '<?xml version="1.0" encoding="utf-8"?>';
retStr += '<Cms>';
retStr += '<SvcCont>';
retStr += '<RbtDeployReportReq>';
retStr += '<TransactionID>'+transID+'</TransactionID>';
retStr += '<Description>全网彩铃的分发操作成功:deployIMPProductReport</Description>';

var lastChar = transID.substring(transID.length - 1);
if(lastChar == 9)
{
	retStr += '<Code>000001</Code>';
}
else
{
	retStr += '<Code>000000</Code>';
}

retStr += '<AccessPlatformID>0001102</AccessPlatformID>';
retStr += '</RbtDeployReportReq>';
retStr += '</SvcCont>';
retStr += '<ProcID>a' + procID + '</ProcID>';
retStr += '</Cms>';
var map = new java.util.HashMap();
map.put('xmldata',retStr);
println(retStr);
HttpClientUtil.post('http://10.25.102.143:5657/CMS4-DIST/ibus/confirmDeployForColorringController.do', 5000, map);